package server;

import org.apache.xmlrpc.*;
import org.apache.xmlrpc.server.*;
import org.apache.xmlrpc.webserver.*;

import game.BoardState;

import java.net.InetAddress;

public class ServerMain {
    private static final int port = 8080;
	public static BoardState game;

    public static void main(String[] args) throws Exception {
    	
    	game = new BoardState();
    	
        WebServer webServer = new WebServer(port);
      
        XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();
      
        PropertyHandlerMapping phm = new PropertyHandlerMapping();
        
        phm.addHandler("Default", server.Handler.class);
        xmlRpcServer.setHandlerMapping(phm);
      
        XmlRpcServerConfigImpl serverConfig =
            (XmlRpcServerConfigImpl) xmlRpcServer.getConfig();
//        serverConfig.setEnabledForExtensions(true);
        serverConfig.setContentLengthOptional(false);

        webServer.start();
    }
}